package mypackage;

/**
 * Created by Brian on 9/24/2014.
 */

public class TestReferences {

    private int age;
    private String name;

    public TestReferences()
    {
        System.out.println("calling default constructor");
    }

    public TestReferences(int age, String name)
    {
        System.out.println("calling defined constructor");
        this.age = age;
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public static void main(String[] args)
    {
        TestReferences tr = new TestReferences(13, "brian");
        int myAge = 5;
        String name = "peter";


        System.out.println("name = " + tr.getName() + ", age = " + tr.getAge());
        System.out.println("name = " + tr.getName() + ", age = " + tr.getAge());

        Utility.doThis(tr);
        Utility.changeAge(myAge);
        Utility.changeName(name);

        System.out.println("name = " + tr.getName() + ", age = " + tr.getAge());
        System.out.println("myAge = " + myAge + ", name = " + name);
    }
}


